﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <link href="css/bootstrap.css" rel="stylesheet" />
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.min.js"></script>
    <script src="js/bootstrap.js"></script>
    <title>FastHttpApi</title>
</head>
<body>
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item active" aria-current="page">FastHttpApi</li>
        </ol>
    </nav>
    <div class="container bs-docs-container">
        <div class="row">
            <div class="col-md-9" role="main">
                <div class="panel panel-default">
                    <div class="panel-heading"> <h3 class="panel-title">JsonPost</h3></div>
                    <div class="panel-body">
                        <form>
                            <div class="form-group">
                                <label for="exampleInputEmail1">Name</label>
                                <input type="text" class="form-control" id="jsonName" placeholder="name">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputPassword1">Value</label>
                                <input type="text" class="form-control" id="jsonValue">
                            </div>

                            <button type="button" onclick="JsonPost()" class="btn btn-primary">submit</button>
                        </form>
                    </div>
                </div>

                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">FormPost</h3>
                    </div>
                    <div class="panel-body">
                        <form>
                            <div class="form-group">
                                <label for="exampleInputEmail1">Name</label>
                                <input type="text" class="form-control" id="formName" placeholder="name">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputPassword1">Value</label>
                                <input type="text" class="form-control" id="formValue">
                            </div>

                            <button type="button" onclick="FormPost()" class="btn btn-primary">submit</button>
                        </form>
                    </div>
                </div>


                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">StreamPost</h3>
                    </div>
                    <div class="panel-body">
                        <form>
                            <div class="form-group">
                                <label for="exampleInputEmail1">Cookie Name</label>
                                <input type="text" class="form-control" id="streamName" placeholder="name">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputPassword1">Value</label>
                                <input type="text" class="form-control" id="streamValue" placeholder="value">
                            </div>
                            <button type="button" onclick="StreamPost()" class="btn btn-primary">submit</button>
                        </form>
                    </div>
                </div>

            </div>
        </div>
    </div>
</body>
<script>
    function JsonPost() {
        $.post("/Post", JSON.stringify({ name: $('#jsonName').val(), value: $('#jsonValue').val() }), function (result) {
            alert(JSON.stringify(result));
        });
    }
    function FormPost() {
        $.post("/PostForm", { name: $('#formName').val(), value: $('#formValue').val() }, function (result) {
            alert(JSON.stringify(result));
        });
    }
    function StreamPost() {
        $.post("/PostStream", { name: $('#streamName').val(), value: $('#streamValue').val() }, function (result) {
            alert(JSON.stringify(result));
        });
    }
</script>
</html>